home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / printers / lpr < prev    next >
Encoding:
Text File  |  1994-08-02  |  2.3 KB  |  78 lines

  1. #!/bin/sh
  2. #
  3. # Subject: making default lp printing dump to lpr
  4. #
  5. # lp interface that invokes lpr.  lpr can then invoke a network printer.
  6. # This file allows printing to lpr from workspace.
  7. #
  8. # Instructions:
  9. #
  10. # Before beginning set up the /etc/printcap and the lpr software.
  11. #
  12. # 1. Create this file in /usr/spool/lp/model.  Filename is lptolpr
  13. # 2. Change the file to be owned by lp:
  14. #        # chown lp lptolpr
  15. #        # chgrp lp lptolpr
  16. # 3. Set the -P argument to lpr in the code below. Here it is set to
  17. #        'remote'.  It should be set to the name of the LPR spooler set-up
  18. #        on this system.
  19. # 4. Install the print spooler:
  20. #        # /usr/lib/lpshut
  21. #        # /usr/lib/lpadmin -p<printer_name> -v/dev/null -mlptolpr
  22. #        # /usr/lib/lpsched
  23. #        # /usr/lib/accept <printer_name>
  24. #        # enable <printer_name>
  25. #        # /usr/lib/lpadmin -d<printer_name>
  26. #
  27. #        <printer_name> = the name of the lp printer on this system.
  28. #
  29. #        To remove the lp printer:
  30. #        # /usr/lib/lpshut
  31. #        # /usr/lib/lpadmin -x<printer_name>
  32. #
  33. #        The command "/usr/lib/lpadmin -d<printer_name>" sets the
  34. #        default printer.  You can also set the default printer from
  35. #        the Print Manager utility.
  36. #
  37. # After the installation is complete the file lptolpr is moved to the
  38. # directory: /usr/spool/lp/interface and is named <printer_name>
  39. #
  40. # Debugging: Chances are you can not type this file in without
  41. # an error. To find a line with the error invoke the script directly
  42. # with the command: 'lptolpr 0 0 0 1 0 /etc/passwd'.  If the script is
  43. # ok the passwd file will print.  If there is a bug you will see the
  44. # line number of the bug.
  45. #
  46. # START CODE
  47. #
  48. # This line     is needed to print from workspace:
  49. TYPE=Dumb
  50. #
  51. # Grab command line     arguments
  52. seqid=$1         # Not used
  53. name=$2i         # Not used
  54. title="$3"       # Not used
  55. copies=$4
  56. options="$5" # Not used
  57. shift; shift; shift; shift;     shift
  58. files="$*"
  59.  
  60. # Print the     files
  61. i=1
  62. while [ $i -le $copies ]
  63. do
  64.         for     file in $files
  65.         do
  66.  
  67. #                         v---- This is the name of the lpr printer
  68. #                                on this system.
  69.  
  70.                 lpr     -Premote  "$file"
  71. #                                ^-- Leave a space here
  72. #                                    (common edit error)
  73.         done
  74.         i=`expr $i + 1`
  75. done
  76.  
  77. exit 0
  78.